﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using KC.Model.Account;

namespace KC.DataAccess.Account.Repository
{
    public interface IOrganizationRepository : Domain.Core.IRepository.IDbTreeRepository<Organization>
    {
        List<Organization> GetAllOrganizationsByParentOrganizationIds(List<int?> parentOrganizationIds);
        IList<Organization> GetAllOrganizationsWithUsers(Expression<Func<Organization, bool>> predicate);
        IList<Organization> GetAllOrganizationsWithUsersByUser(Expression<Func<Organization, bool>> predicate, string userName, string userCode, string searchKey);
        IList<Organization> GetOrganizationList(Expression<Func<Organization, bool>> predicate);
        Organization GetOrganizationsAndUsersByOrgId(int orgId);
        IList<Organization> GetOrganizationsWithUsersByFilter<K>(Expression<Func<Organization, bool>> predicate, Expression<Func<Organization, K>> keySelector, bool ascending = true);
        IQueryable<Organization> GetRootOrganizations(Expression<Func<Organization, bool>> predicate);
        Organization GetUsersByOrganizationId(int id);
        List<User> GetUsersByOrgId(int id);
        List<User> GetUsersByOrgIds(List<int> ids);
        List<User> GetUsersByOrgIdWithoutOrg(int id);
    }
}